<?php
$this->houseme_view->header();

$temp_comment_data = $this->session->userdata('temp_comment_data');


?>

<div id="votecontainer">
       <div class="votecontainer_l">
        <div class="votebox">
           <div class="content">
                <div class="vote_title">投票:<?php echo $question[0]['title'];?></div>
                <div class="vote_info">
                    <!--<div class="foto"><img src="images/ask/ex_40x40.jpg" alt=""></div>-->
                    <div class="txt">
                         <div class="name">提問人:<?php echo !empty($question[0]['name'])?$question[0]['name']:$question[0]['email']; ?></div>
                         
                         <div class="time"><?php echo $question[0]['create_time'];?></div>
                    </div>
                    <div class="c"></div>
                </div>
                <div class="vote_txt"><?php echo $question[0]['desc'];?></div>
                <div class="vote_choose">
                   <!--投票列表-->
                   <?php foreach ($votes as $key => $value) { ?>
                    <div class="vcbox">
                        <div class="foto"><a class="thumb_images" href="<?php echo $this->config->item('image_uploader_question_vote_original', 'layout').$question[0]['uid'].'/'.$value['image']; ?>"><img src="<?php echo $this->config->item('image_uploader_question_vote_thumbs', 'layout').$question[0]['uid'].'/'.$value['image']; ?>" alt=""></a></div>
                        <div class="barcontent">
                        <?php if(!empty($value['photo_desc'])){ ?>
                            <div class="vote_photo_desc" ><?php echo $value['photo_desc']; ?></div>
                        <?php } ?>
                            <div class="btn_vote"><a onclick="voteThis('<?php echo $question[0]['id']; ?>','<?php echo $value['id']; ?>');" href="javascript:;">投票</a></div>
                            <div class="votebar"><div class="bar" id="votebar_<?php echo $value['id']; ?>" style="width:<?php echo $value['vote_counts']; ?>%"></div><div id="votenum_<?php echo $value['id']; ?>" class="num"><?php echo $value['vote_counts']; ?>票</div></div>
                        </div>
                        <div class="c"></div>
                    </div>
                   <?php } ?>
                </div>
               
            </div>
        </div>
         <div class="vote_list">
         <div id="comment_area">
            <?php foreach($comments as $key=>$val){ ?>
            <div class="list">
                <!--<div class="foto"><img src="images/ask/ex_40x40.jpg" alt=""></div>-->
                <div class="txt">
                     <div class="voteshare">
                        <h1><?php echo !empty($val['name'])?$val['name']:$val['email']; ?></h1>
                        <!--
                        <div class="vsicon">
                            <div class="txt2">Like</div>
                            <div class="icon"><a href="#"><img src="images/ask/like.png" alt=""></a></div>
                            <div class="num">10</div>
                        </div>
                        -->
                        <div class="vstxt"><?php echo $val['comment_time']; ?></div>
                        <div class="c"></div>
                    </div>
                    <div class="txt3"><?php echo $val['comment']; ?></div>
                    <?php if(!empty($val['images'])){ 
                          $val['images'] = json_decode($val['images'],true);
                          ?>
                            <div class="vfoto">
                              <?php foreach($val['images'] as $k=>$v) {?>
                                  <a href="<?php echo $this->config->item('image_uploader_comment_original', 'layout').$val['uid'] .'/'.$v; ?>" class="thumb_images"><img src="<?php echo $this->config->item('image_uploader_comment_thumbs', 'layout').$val['uid'] .'/'.$v; ?>" alt=""></a>
                              <?php } ?>
                            </div>
                        <?php } ?>
                    </div>
                    <div class="c"></div>
            </div>
              <?php } ?>
          </div>
                <!--評論-->
                <form method="post" action="/question/comment_on_question" name="commentForm" id="commentForm">
                <div class="uploadcomment">
                    <input name="question_id" value="<?php echo $question[0]['id']; ?>" type="hidden" />
                    <textarea id="comment" name="comment" id="" cols="30" rows="10"><?php echo $temp_comment_data; ?></textarea>
                    <div id="attachment_image" class="hidden-sm hidden-xs">
                      <div class="load1" id="votePhotosArea" ></div>
                      <div class="attachment_addfoto"><a onclick="addCommentPhoto();" href="javascript:;">附加圖片</a></div>
                      <div class="c"></div>
                    </div>
                    <div class="votebtn">
                        <!--<div class="btn"><a href="#">上傳圖片</a></div>-->
                        <div class="btn"><a id="submit_comment" onclick="initialAjaxCommentForm();" href="javascript:;">留下意見</a></div>
                        <div class="c"></div>
                    </div>
                </div>
                </form>
            </div>
            </div>
            <!--
        <div class="votecontainer_r">
             <div class="ask_choose">
               <div class="title">文章選擇</div>
               <ul>
                   <li><a href="#">選擇一</a></li>
                   <li><a class="select" href="#">選擇一</a></li>
                   <li><a href="#">選擇一</a></li>
                   <li><a href="#">選擇一</a></li>
               </ul>
           </div>
           <div class="ask_populer">
               <div class="title">受歡迎的文章</div>
               <ul>
                  <li>
                      <div class="foto"><img src="images/ask/ex_100x100.jpg" alt=""></div>
                      <div class="txt">
                          <h1>不知道該選哪個壁紙?</h1>
                          <span>假字假字假字假字假字假字假字假字假字</span>
                          <div class="name">nacy</div>
                          <div class="cicon"><a href="#">30</a></div>
                      </div>
                      <div class="c"></div>
                  </li>
                     <li>
                      <div class="foto"><img src="images/ask/ex_100x100.jpg" alt=""></div>
                      <div class="txt">
                          <h1>不知道該選哪個壁紙?</h1>
                          <span>假字假字假字假字假字假字假字假字假字</span>
                          <div class="name">nacy</div>
                          <div class="cicon"><a href="#">30</a></div>
                      </div>
                      <div class="c"></div>
                  </li>
                  <li>
                      <div class="foto"><img src="images/ask/ex_100x100.jpg" alt=""></div>
                      <div class="txt">
                          <h1>不知道該選哪個壁紙?</h1>
                          <span>假字假字假字假字假字假字假字假字假字</span>
                          <div class="name">nacy</div>
                          <div class="cicon"><a href="#">30</a></div>
                      </div>
                      <div class="c"></div>
                  </li>
               </ul>
           </div>
            
        </div>
        -->
        <div class="c"></div>
    </div>
<?php
$this->houseme_view->footer();
?>